package com.shide.flow.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.function.Function;

import com.shide.flow.demo.core.Execution;
import com.shide.flow.demo.core.FlowContext;
import com.shide.flow.demo.core.FlowCreator;
import com.shide.flow.demo.model.NodeModel;
import lombok.Data;

/**
 * 流程定义表
 *
 * @TableName flow_process
 */
@TableName(value = "flow_process")
@Data
public class FlowProcess implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 流程定义key
     */
    private String processKey;

    /**
     * 流程名称
     */
    private String processName;

    /**
     * 流程类型
     */
    private String processType;

    /**
     * 使用范围 0，全员 1，指定人员（业务关联） 2，均不可提交
     */
    private Integer useScope;

    /**
     * 流程状态 0，不可用 1，可用 2，历史版本
     */
    private Integer processState;

    /**
     * 流程模型定义JSON内容
     */
    private String modelContent;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


    public FlowInstance executeStartModel(FlowContext flowContext, FlowCreator flowCreator, Function<NodeModel, Execution> function) {
        FlowInstance flowInstance = null;
        if (this.modelContent != null) {
        }
        return flowInstance;
    }
}